﻿namespace NKernel.Core
{
    /// <summary>
    /// Logical description of a component installed inside NKernel.
    /// </summary>
    public interface IComponentObject
    {
        #region Properties

        /// <summary>
        /// Actual name of the assembly without the suffix (currently assumed to be 'DLL')
        /// </summary>
        string AssemblyName
        {
            get;
        }

        /// <summary>
        /// Gets the component implementation.
        /// </summary>
        /// <value>The component implementation.</value>
        string ComponentImplementation
        {
            get;
        }

        /// <summary>
        /// Gets the component interface.
        /// </summary>
        /// <value>The component interface.</value>
        string ComponentInterface
        {
            get;
        }

        /// <summary>
        /// Gets the component interface instance.
        /// </summary>
        /// <value>The component interface instance.</value>
        object ComponentInterfaceInstance
        {
            get;
        }

        /// <summary>
        /// Gets the human-understandable name of the component.
        /// </summary>
        /// <value>The name of the component.</value>
        string ComponentName
        {
            get;
        }

        /// <summary>
        /// Gets or sets the version.
        /// </summary>
        /// <value>The version.</value>
        string ComponentVersion
        {
            get;
        }

        /// <summary>
        /// Gets or sets the component state.
        /// </summary>
        /// <value>Component state</value>
        ComponentStateType State
        {
            get; set;
        }

        #endregion Properties

        #region Methods

        /// <summary>
        /// Cleanups the component state after it has stoppped.
        /// </summary>
        void Cleanup();

        /// <summary>
        /// Initialises the component.
        /// </summary>
        void Init();

        /// <summary>
        /// Starts the component.
        /// </summary>
        void Start();

        /// <summary>
        /// Stops the component.
        /// </summary>
        void Stop();

        #endregion Methods
    }
}